package 内地居民结婚登记数占比;


import org.apache.hadoop.io.Writable;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;

public class MarriageRatioBean implements Writable {
    private float marriageCount;//结婚登记数
    private float firstmarriageCount;//初婚
    private float remarriageCount;//再婚
    private double marriageRation;//初婚占比
    private double marriageRation1;//再婚占比


    public MarriageRatioBean(){

    }

    public MarriageRatioBean(float marriageCount, float firstmarriageCount, float remarriageCount, double marriageRation, double marriageRation1) {
        this.marriageCount = marriageCount;
        this.firstmarriageCount = firstmarriageCount;
        this.remarriageCount = remarriageCount;
        this.marriageRation = marriageRation;
        this.marriageRation1 = marriageRation1;
    }

    public void set(float marriageCount,float firstmarriageCount,float remarriageCount){
        this.marriageCount = marriageCount;
        this.firstmarriageCount = firstmarriageCount;
        this.remarriageCount = remarriageCount;
    }

    public void set(double marriageRation,double marriageRation1) {
        this.marriageRation = marriageRation;
        this.marriageRation1 = marriageRation1;
    }

    public float getMarriageCount(){ return marriageCount; }

    public void setMarriageCount(float marriageCount){ this.marriageCount = marriageCount; }

    public float getFirstmarriageCount() {
        return firstmarriageCount;
    }

    public void setFirstmarriageCount(float firstmarriageCount) {
        this.firstmarriageCount = firstmarriageCount;
    }

    public float getRemarriageCount() {
        return remarriageCount;
    }

    public void setRemarriageCount(float remarriageCount) {
        this.remarriageCount = remarriageCount;
    }

    public double getMarriageRation() {
        return marriageRation;
    }

    public void setMarriageRation(double marriageRation) {
        this.marriageRation = marriageRation;
    }

    public double getMarriageRation1(){ return marriageRation1; }

    public void setMarriageRation1(double marriageRation1){ this.marriageRation1 = marriageRation1; }


    @Override
    public String toString() {
        return "初婚登记数占比：" + marriageRation + "\t" + "再婚登记数占比：" + marriageRation1;
    }

    @Override
    public void write(DataOutput dataOutput) throws IOException {
        dataOutput.writeFloat(marriageCount);
        dataOutput.writeFloat(firstmarriageCount);
        dataOutput.writeFloat(remarriageCount);
        dataOutput.writeDouble(marriageRation);
        dataOutput.writeDouble(marriageRation1);
    }

    @Override
    public void readFields(DataInput dataInput) throws IOException {
        this.marriageCount = dataInput.readFloat();
        this.firstmarriageCount = dataInput.readFloat();
        this.remarriageCount = dataInput.readFloat();
        this.marriageRation = dataInput.readDouble();
        this.marriageRation1 = dataInput.readDouble();
    }


}


